<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/base/BaseFormFilterPropel.class.php');

/**
 * SfGuardUserProfile filter form base class.
 *
 * @package    tercermilenio
 * @subpackage filter
 * @author     Your name here
 */
class BaseSfGuardUserProfileFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'usr_id'     => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => true)),
      'telefono_1' => new sfWidgetFormFilterInput(),
      'telefono_2' => new sfWidgetFormFilterInput(),
      'tipo_doc'   => new sfWidgetFormFilterInput(),
      'nro_doc'    => new sfWidgetFormFilterInput(),
      'direccion'  => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'usr_id'     => new sfValidatorPropelChoice(array('required' => false, 'model' => 'sfGuardUser', 'column' => 'id')),
      'telefono_1' => new sfValidatorPass(array('required' => false)),
      'telefono_2' => new sfValidatorPass(array('required' => false)),
      'tipo_doc'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'nro_doc'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'direccion'  => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('sf_guard_user_profile_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'SfGuardUserProfile';
  }

  public function getFields()
  {
    return array(
      'id'         => 'Number',
      'usr_id'     => 'ForeignKey',
      'telefono_1' => 'Text',
      'telefono_2' => 'Text',
      'tipo_doc'   => 'Number',
      'nro_doc'    => 'Number',
      'direccion'  => 'Text',
    );
  }
}
